<!DOCTYPE html>
<html>
<head>
   <title>API说明</title>
   <link href="{{ config.STATIC_NAME }}/css/bootstrap.min.css" rel="stylesheet">
   <script src="{{ config.STATIC_NAME }}/js/jquery-1.9.1.min.js"></script>
   <script src="{{ config.STATIC_NAME }}/js/bootstrap.min.js"></script>
</head>
<meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1">
<body style="max-width: 1000px;margin: auto;">
<div style="width: 100%;height: 60px;">
	
</div>
<div style="width:26%;float: left;">
	<ul class="nav nav-pills nav-stacked" id="myTab"> 
		{% for t in data %}
			<li><a id="a{{ t.name }}" href="#{{ t.name }}">
				{% for s in t.doc.name %}
					{{ s.0 }}<br>
				{% endfor %}
			</a></li> 
		{% endfor %}
	</ul> 
	<a class="btn-primary" style="display: block;height: 40px;line-height: 40px;width: 100%;text-align: 40px;" href="/{{ url.path }}/help/doc">返回</a>
</div>
       
<div class="tab-content" style="width:73%;float: left;"> 
	{% for t in data %}
		<div class="tab-pane" id="{{ t.name }}">
			<div style="margin: 10px;">
				<div style="width: 100%">
					<b>接口名</b>
				</div>
				<div class="alert alert-success">
					{% for s in t.doc.name %}
						{{ s.0 }}<br>
					{% endfor %}
				</div>
				<div style="width: 100%">
					<b>接口描述</b>
				</div>
				<div class="alert alert-info">
					{% for s in t.doc.bewrite %}
						{{ s.0 }}<br>
					{% endfor %}
				</div>
				<div style="width: 100%">
					<b>请求类型及路径</b>
				</div>
				<div class="alert alert-info">
					http://{{request.urlparts.netloc}}{{ t.url }}
				</div>
				<div style="width: 100%">
					<b>请求示例</b>
				</div>
				<div class="alert alert-info">
					http://{{request.urlparts.netloc}}{{ t.url }}{% if t.doc.field %}?{% for s in t.doc.field %}{{s.0}}={{s.1}}&{% endfor %}{% endif %}
				</div>
				{% if t.doc.field %}
					<div>
						<table class="table table-hover">
							<caption><b>参数说明</b></caption>
							<thead>
							  <tr>
							     <th>参数名称</th>
							     <th>参数说明</th>
							     <th>备注</th>
							  </tr>
							</thead>
							<tbody>
								{% for s in t.doc.field %}
									<tr>
										{% for f in s %}
											<td>{{ f }}</td>
										{% endfor %}
									</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>
				{% endif %}
				<div style="width: 100%">
					<b>返回</b>
				</div>
				<div class="alert alert-info">
					{status:200, message:"", data:""}
				</div>
				{% if t.doc.return %}
					<div>
						<table class="table table-hover">
							<caption><b>返回值说明(data)</b></caption>
							<thead>
							  <tr>
							     <th>返回值名称</th>
							     <th>返回值说明</th>
							     <th>备注</th>
							  </tr>
							</thead>
							<tbody>
								{% for s in t.doc.return %}
									<tr>
										{% for f in s %}
											<td>{{ f }}</td>
										{% endfor %}
									</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>
				{% endif %}
				{% if t.doc.returncode %}
					<div>
						<table class="table table-hover">
							<caption><b>返回值代码(status)</b></caption>
							<thead>
							  <tr>
							     <th>返回代码名称</th>
							     <th>返回代码说明</th>
							     <th>备注</th>
							  </tr>
							</thead>
							<tbody>
								{% for s in t.doc.returncode %}
									<tr>
										{% for f in s %}
											<td>{{ f }}</td>
										{% endfor %}
									</tr>
								{% endfor %}
							</tbody>
						</table>
					</div>
				{% endif %}
			</div>
		</div> 
	{% endfor %}
</div> 
       
<script> 
  $(function () { 
    $('#myTab a').click(function (e) { 
      e.preventDefault();//阻止a链接的跳转行为 
      $(this).tab('show');//显示当前选中的链接及关联的content 
    }) 
  	$('#a{{ data.0.name }}').click();
  }) 
</script>

</body>
</html>
